<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>第三个js页面</title>
    <script type="text/javascript">
        // var arr = new Array(1,2,3,4);
        // var arr_new = arr.concat(5,6);
        // console.info(arr);
        // console.info(arr_new);
        // console.info(arr.slice(1));
        // console.info(arr.slice(1,3));//slice 从index为1开始获取，到index为3结束(左闭右开)
        // console.info(arr.splice(1,2));
        // var arr_new2 = arr.splice(1,2,"ee","ff");
        // console.info(arr_new2);
        /*
        console.info(arr);
        console.info(arr.reverse());
        console.info(arr.join("||"))
        console.info(arr.sort());
        console.info(arr.sort(compare));
        function compare(v1,v2) {
            return v1>v2?-1:1;
        }
         */
        var arr = ["tom","11","rose","11"];
        console.info(arr);
        console.info(arr.toString());
        console.info(arr.toLocaleString());
        console.info(arr.indexOf("11"))
        console.info(arr.lastIndexOf("11"));
        console.info(arr.valueOf());
        arr[4] = 10;
        console.info(arr.length)
        console.info(typeof(arr));
        console.info(Array.isArray(arr));
        /*
        for(var i=0;i<arr.length;i++) {
            console.info(arr[i]);
        }
         */
    </script>
</head>
<body>

</body>
</html>